﻿#region Using

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;

using Gizmox.WebGUI.Common;
using Gizmox.WebGUI.Forms;

#endregion

namespace VisualWebGuiApplication2
{
    public partial class TankInvoice : UserControl
    {
        int lastid = 0;
      /*  BindingSource _bsTankOpen;
        GazOnDevEntities db2 = new GazOnDevEntities();*/
        Configdb dbconf;
         Tank_Stocks tanktofix;
        bool havetank=false;
        bool edit = false;
     
      //   Invoice selected;
         BindingList<invoiceitem> _currentinvoiceitems = new BindingList<invoiceitem>();
         Invoice _currentinvoice = new Invoice();
         public TankInvoice()
        {
            InitializeComponent();

          dataGridView1.CellClick+=new DataGridViewCellEventHandler(dataGridView1_CellClick);
             dataGridView1.KeyDown +=new KeyEventHandler(dataGridView1_KeyDown);
             this.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
            txtinvoiceid.Leave += new EventHandler(txtinvoiceid_Leave);
            txtTankNymber.Leave += new EventHandler(txtTankNymber_Leave);
            dataGridView1.AllowUserToAddRows = true;
            dataGridView1.ReadOnly = false;
            dataGridView1.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2;
            
             //dataGridView1.KeyDown+=new KeyEventHandler(dataGridView1_KeyDown);
             //dataGridView1.KeyPress += new KeyPressEventHandler(dataGridView1_KeyPress);
            using (GazOnDevEntities db= new GazOnDevEntities())
            {
               

                 dbconf= db.Configdbs.FirstOrDefault();
                txtinvoiceid.Text = dbconf.invoicelastid;
                txtcreatedby.Text = string.Format("{0}", Session["username"]);
            
                var query = from p in db.Accompanying_stocks
                                 where p.isininvoice == true
                                 orderby p.invoiceorder ascending
                                 select p;
                List<Accompanying_stocks>  newstocklist = new List<Accompanying_stocks>(query.ToList<Accompanying_stocks>());
                Accompanying_stocks temp=new Accompanying_stocks();
                int k = 1;
                foreach (Accompanying_stocks item in newstocklist)
                { invoiceitem invitm=new invoiceitem();
                    invitm.invoiceid =txtinvoiceid.Text;
                     invitm.title =item.Title;
                     invitm.type = "stock";
                     invitm.typeid = item.Id.ToString();
                     invitm.num = k.ToString();
                     k++;
                     _currentinvoiceitems.Add(invitm);
                    
                }
                
                bindingSource1.DataSource = _currentinvoiceitems;
                //stocklist.Add(temp);
                //stocklist.Add(temp);


                // must icrease id of invoice id  ;
            }

            
          //  textBox1.Leave += new EventHandler(textBox1_Leave);
           
        }

         void dataGridView1_KeyPress(object sender, KeyPressEventArgs e)
         {
             //if (e.KeyChar ==(char) Keys.Select)
             //{
             //    e.Handled = true;
             //    DataGridViewCell cell = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[dataGridView1.CurrentCell.ColumnIndex];
             //    dataGridView1.CurrentCell = cell;
             //    dataGridView1.CurrentCell.ReadOnly = false;
             //    dataGridView1.BeginEdit(true);
             //}
         }
         private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
         {
             dataGridView1.AllowUserToAddRows = true;
             if (e.KeyCode == Keys.Space )
             {
                // e.Handled = true;
                 if (dataGridView1.CurrentCell.ColumnIndex == 2)
                 {
                     return;
                 }
                 if (dataGridView1.CurrentCell.ColumnIndex == 4)
                 {
                     return;
                 }
                 DataGridViewCell cell = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[dataGridView1.CurrentCell.ColumnIndex];
                 dataGridView1.CurrentCell = cell;
                 dataGridView1.CurrentCell.ReadOnly = false;
                 dataGridView1.BeginEdit(true);
             }

             //if (e.KeyCode == Keys.Escape)
             //{
             //    e.Handled = true;
             //    DataGridViewCell cell = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[dataGridView1.CurrentCell.ColumnIndex];
             //    dataGridView1.CurrentCell = cell;
             //    dataGridView1.CurrentCell.ReadOnly = true;
             //    dataGridView1.EndEdit();
             //}
         }
         void txtTankNymber_Leave(object sender, EventArgs e)
         {
             bool error = false;
             
             if (!string.IsNullOrEmpty(txtTankNymber.Text))
             {
                 using (GazOnDevEntities db = new GazOnDevEntities())
                 {
                     tanktofix = db.Tank_Stocks.FirstOrDefault(x => x.TankNumber == txtTankNymber.Text);
                     if (null != tanktofix)
                     {
                         tanktofix.dateofExit = DateTime.Now.ToString("dd.MM.yyyy");
                         db.SaveChanges();
                     }
                 }
                 if (null == tanktofix)
                 {
                     MessageBox.Show("לא קיים מספר צובר כזה ");
                     return;

                 }
                 if (!string.IsNullOrEmpty(tanktofix.invoiceid))
                 {
                     MessageBox.Show("צובר עם מספר זה  מקושר כבר לתעןדת משלוח  מס  " + tanktofix.invoiceid);
                   
                     return;
                 }

                 if (tanktofix.Id < 1)
                 {
                     error = true;
                 }
             }
             else
             {
                 error = false;


             }

             if (error)
             {
                 MessageBox.Show("לא קיים מספר צובר כזה ");
             }
             else
             {
              //   button1.Enabled = true;

                 if (tanktofix != null)
                 {
                     txtTankDescription.Text = "צובר " + tanktofix.Tank_Size + " גלון מספר " + tanktofix.TankNumber;
                     if(!string.IsNullOrEmpty(tanktofix.TankFixNumber))
                     {
                     
                     txtTankDescription.Text +=  " מספר שיפוץ " + tanktofix.TankFixNumber;
                     }
                 }
         
                



             }
         }

         public TankInvoice(string invoiceid)
         {
             InitializeComponent();

             dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick);
             dataGridView1.KeyDown += new KeyEventHandler(dataGridView1_KeyDown);
             this.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
             txtinvoiceid.Leave += new EventHandler(txtinvoiceid_Leave);
             txtTankNymber.Leave += new EventHandler(txtTankNymber_Leave);
             txtinvoiceid.Text = invoiceid;
             EventArgs ev=new EventArgs();

             txtinvoiceid_Leave(txtinvoiceid, ev);
             txtTankNymber_Leave(txtTankNymber, ev);
             /*using (GazOnDevEntities db = new GazOnDevEntities())
             {
               
                       _currentinvoice = db.Invoices.FirstOrDefault(x => x.invoiceNumber == invoiceid);

               
                 // must icrease id of invoice id  ;
             }*/
             //  textBox1.Leave += new EventHandler(textBox1_Leave);

         }
         private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
         {
             // delete gridview row  
             edit = true;
             if (e.ColumnIndex == 0)
             {
                 // MessageBox.Show(string.Format("CellClick Row={0} Col={1} DataSourceCheckBoxValue={2}", e.RowIndex, e.ColumnIndex, e.ColumnIndex) + Environment.NewLine);
                 string ctype = string.Empty, dttype = string.Empty;
                 if (null != dataGridView1.Rows[e.RowIndex].Cells["dttype"])
                 {
                     ctype = dataGridView1.Rows[e.RowIndex].Cells["dttype"].ToString();
                 }

                 if (null != dataGridView1.Rows[e.RowIndex].Cells["dttypeid"])
                 {
                     dttype = dataGridView1.Rows[e.RowIndex].Cells["dttypeid"].ToString();
                 }
                 if (ctype == "tank")
                 {
                     updateTankStock(dttype, "");

                 }
                 dataGridView1.Rows.RemoveAt(e.RowIndex);


             }
             else {

                 DataGridViewCell cell = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[dataGridView1.CurrentCell.ColumnIndex];
                 dataGridView1.CurrentCell = cell;
                 dataGridView1.CurrentCell.ReadOnly = false;
                 dataGridView1.BeginEdit(true);
             }
             

             /*else
                 MessageBox.Show(string.Format("CellClick Row={0} Col={1}", e.RowIndex, e.ColumnIndex) + Environment.NewLine);*/
         }

         void txtinvoiceid_Leave(object sender, EventArgs e)
         {
             using (GazOnDevEntities db = new GazOnDevEntities())
             {
                 _currentinvoice = db.Invoices.FirstOrDefault(x => x.invoiceNumber == txtinvoiceid.Text);

                 if (null == _currentinvoice) _currentinvoice=db.Invoices.FirstOrDefault(x => x.tankNumber == txtinvoiceid.Text);
                 if ((null != _currentinvoice) && (_currentinvoice.id > 0))
                 {
                     edit = true;
                     MessageBox.Show("תעודת משלוח עם מספר כזה קיימת  אתה עובר למצב תצוגה");
                   //  havetank = Convert.ToBoolean(_currentinvoice.havetank);
                     // set buttun to disable 
                     //button1.Enabled = false;
                     //btnReportPrint.Enabled = false;
                     //btnPrint.Enabled = false;
                     //btnupload.Enabled = false;
                     //foreach (Control item in dataGridView1.Controls)
                     //{
                     //    item.Enabled = false;
                         
                     //}
                     /*foreach (Control item in this.Controls)
                     {
                         item.Enabled = false;
                     }*/

                     dataGridView1.Enabled = false;
                    txtAddress.Enabled=true ;
                    txtTo.Enabled = true;
                    txtCarNum.Enabled = true;
                    DatetimePicker.Enabled = true;
                    txtinvoiceid.Enabled = true;
                    txtTankDescription.Enabled = true;
                    txtCarTransporter.Enabled = true;
                    txtNote.Enabled = true;
                     btnPrint.Enabled = true;
                   

                     txtAddress.Text = _currentinvoice.address;
                     txtTo.Text = _currentinvoice.C_to;
                     txtCarNum.Text = _currentinvoice.carnum;
                     DatetimePicker.Value = Convert.ToDateTime(_currentinvoice.date);
                     txtinvoiceid.Text = _currentinvoice.invoiceNumber;
                     txtCarTransporter.Text = _currentinvoice.transporter;
                     txtTankNymber.Text = _currentinvoice.tankNumber;
                     txtTankDescription.Text = _currentinvoice.tankDesc;
                     txtNote.Text = _currentinvoice.note;
                     txtManualnum.Text = _currentinvoice.manualNumber;
                     if (string.IsNullOrEmpty(_currentinvoice.cteatedby))
                     {
                         txtcreatedby.Text = string.Format("{0}", Session["username"]);
                     }
                     else
                     {
                         txtcreatedby.Text = _currentinvoice.cteatedby;
                     }
                     // increase invoice id number

                     var query = from p in db.invoiceitems
                                 where p.invoiceid == txtinvoiceid.Text
                                 orderby p.id ascending
                                 select p;
                     _currentinvoiceitems = new BindingList<invoiceitem>(query.ToList<invoiceitem>());

                     bindingSource1.DataSource =_currentinvoiceitems;




                     

                 }
                 else
                 { 
                 
                 // set buttns to enable 
                     edit = false;
                        //btnReportPrint.Enabled = true;
                        // btnPrint.Enabled = true;
                        // btnupload.Enabled = true;
                        // button1.Enabled = true;
                        // havetank = false;
                        // foreach (Control item in dataGridView1.Controls)
                        // {
                        //     item.Enabled = true;

                        // }

	               
                 }
             }
         }

        


       


   
     
     

    
        private void btnOpenTank_Click(object sender, EventArgs e)
        {
          
           

          
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("button1_Click");
        }

        private void btnupload_Click(object sender, EventArgs e)
        {
            MessageBox.Show("btnupload_Click");
        }

        private void btnReportPrint_Click(object sender, EventArgs e)
        {
            using (GazOnDevEntities db = new GazOnDevEntities())
            {
                tanktofix = db.Tank_Stocks.FirstOrDefault(x => x.TankNumber == txtTankNymber.Text);

                if (null != tanktofix)
                {
                    tanktofix.TankSystemStatus = "4";
                    tanktofix.invoiceid = txtinvoiceid.Text;
                    try
                    {
                        db.Attach(tanktofix);

                        db.ObjectStateManager.ChangeObjectState(tanktofix, EntityState.Modified);
                    }
                    catch {
                        db.ObjectStateManager.ChangeObjectState(tanktofix, EntityState.Modified);
                    
                    }
                }

             Invoice   temp = db.Invoices.FirstOrDefault(x => x.invoiceNumber == txtinvoiceid.Text);
             if ((null == temp))
             {
                 edit = false;
             }
             else
             {
                 edit = true;
             }
           




                if (edit)
                {
                    try
                    {
                        _currentinvoice = temp;
                        _currentinvoice.address = txtAddress.Text;
                        _currentinvoice.C_to = txtTo.Text;
                        _currentinvoice.carnum = txtCarNum.Text;
                        _currentinvoice.date = DatetimePicker.Value;
                        _currentinvoice.invoiceNumber = txtinvoiceid.Text;
                        _currentinvoice.manualNumber = txtManualnum.Text;
                        _currentinvoice.note = txtNote.Text;
                       // _currentinvoice.tankNumber = tanktofix.TankNumber;
                        _currentinvoice.tankDesc = txtTankDescription.Text;
                        _currentinvoice.cteatedby = txtcreatedby.Text;
                        // increase invoice id number
                        _currentinvoice.transporter = txtCarTransporter.Text;
                        db.Attach(_currentinvoice);
                        db.Attach(tanktofix);
                        db.ObjectStateManager.ChangeObjectState(_currentinvoice, EntityState.Modified);
                        db.ObjectStateManager.ChangeObjectState(tanktofix, EntityState.Modified);
                    }catch(Exception eddd){}
                 

                   /* foreach (invoiceitem item in bindingSource1.List)
                    {
                        if (null != item.amount)
                        {
                            updateStockAmount(item);
                        }
                             try{
                        db.Attach(item);
                        db.ObjectStateManager.ChangeObjectState(item, EntityState.Modified);
                         }catch(Exception eddd){}
                    }*/
                }
                else
                {

                    foreach (invoiceitem item in bindingSource1.List)
                    {
                        //invoiceitem item = new invoiceitem();
                        ////stocklist.
                        // item.invoiceid = txtinvoiceid.Text;

                        if (null != item.amount)
                        {
                            updateStockAmount(item);
                        }
                        db.AddToinvoiceitems(item);
                    }
                }
                
                //}


                if (dbconf != null)
                {
                    if (!edit)
                    {
                        dbconf.invoicelastid = (Convert.ToInt32(dbconf.invoicelastid) + 1).ToString();
                        db.Attach(dbconf);
                        db.ObjectStateManager.ChangeObjectState(dbconf, EntityState.Modified);
                    }
                }
                if (edit)
                {
                  
                }
                else
                {
                    if (_currentinvoice == null)
                    {
                        _currentinvoice = new Invoice();
                    }
                    _currentinvoice.address = txtAddress.Text;
                    _currentinvoice.C_to = txtTo.Text;
                    _currentinvoice.carnum = txtCarNum.Text;
                    _currentinvoice.date = DatetimePicker.Value;
                    _currentinvoice.invoiceNumber = txtinvoiceid.Text;
                    _currentinvoice.tankNumber = tanktofix.TankNumber;
                    _currentinvoice.tankDesc = txtTankDescription.Text;
                    
                    // increase invoice id number
                    _currentinvoice.transporter = txtCarTransporter.Text;
                    db.AddToInvoices(_currentinvoice);
                   
                    
                }
                if (db.SaveChanges() > 0)
                {



                    // MessageBox.Show("פעולת ההוספה הצליחה");
                    frmReportTankRecipet tanko = new frmReportTankRecipet(Convert.ToInt32(_currentinvoice.invoiceNumber), "report3");
                    tanko.ShowDialog();
                    //btnOpenTank.Enabled = false;

                }
                else
                {
                    MessageBox.Show("פעולת ההוספה נכשלה");

                }
            }
          //  btnOpenTank.Enabled = false;
          /*  frmReportTankRecipet tanko = new frmReportTankRecipet(tanktofix.Id, "report3");
            tanko.ShowDialog();*/
        }

        private void updateStockAmount(invoiceitem item)
        {
            using (GazOnDevEntities db=new GazOnDevEntities())
            {
                int idd=Convert.ToInt32(item.typeid);
                Accompanying_stocks tepstock = db.Accompanying_stocks.SingleOrDefault(x => x.Id == idd);

                int amount= Convert.ToInt32(tepstock.Count) - Convert.ToInt32(item.amount);
                tepstock.Count = amount.ToString();
                var entry = db.ObjectStateManager.GetObjectStateEntry(tepstock);
                if (entry.State == EntityState.Detached)
                {
                    // Do Something
                    db.Attach(tepstock);
                }
               
                db.ObjectStateManager.ChangeObjectState(tepstock, EntityState.Modified);
                db.SaveChanges();
                
            }
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
          /*  MessageBox.Show("button1_Click_1");*/
            InvoiceControlAccompanyStockAdd dd = new InvoiceControlAccompanyStockAdd();
            dd.FormClosing +=new Gizmox.WebGUI.Forms.Form.FormClosingEventHandler(dd_FormClosing);

          
            dd.ShowDialog();

            
          
        }

        void dd_FormClosing(object sender, FormClosingEventArgs e)
        {

                 /* dtclmnid;
        dtclmnTitle;
        dtclmnAmount;
   dtclmnNote;*/
            //_currentinvoiceitems.Add(

           
            
            invoiceitem newrow = new invoiceitem();
            InvoiceControlAccompanyStockAdd ctrl = (InvoiceControlAccompanyStockAdd)sender;
            if (string.IsNullOrEmpty(ctrl.Title) || string.IsNullOrEmpty(ctrl.Amount))
                return;
            int i;
            i = dataGridView1.Rows.Add( new DataGridViewRow());

            DataGridViewCell cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl.Title;
            newrow.title = ctrl.Title;
            dataGridView1.Rows[i].Cells["dtclmnTitle"] = cell1;

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl.Note;
            newrow.note = ctrl.Note;
            dataGridView1.Rows[i].Cells["dtclmnNote"] = cell1;

           

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl.Amount;
            newrow.amount = Convert.ToInt32(ctrl.Amount);
            dataGridView1.Rows[i].Cells["dtclmnAmount"] = cell1;

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = i+1;
            newrow.num = (i + 1).ToString();
            dataGridView1.Rows[i].Cells["dtclmnid"] = cell1;


            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl._Type;
            newrow.type = ctrl._Type;
            dataGridView1.Rows[i].Cells["dttype"] = cell1;

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl._Typeid;
            newrow.typeid = ctrl._Typeid;
            dataGridView1.Rows[i].Cells["dttypeid"] = cell1;


            DataGridViewButtonCell cell2 = new DataGridViewButtonCell();
            cell2.Value = "מחיקה";
            dataGridView1.Rows[i].Cells["dtbttndelet"] = cell2;

            _currentinvoiceitems.Add(newrow);


            


           /* cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl.Title;
            dataGridView1.Rows[i].Cells["Amount"] = cell1;

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl.Title;
            dataGridView1.Rows[i].Cells["Title"] = cell1;*/
            
        }
        private void updateTankStock(string tankids,string invoicenumber)
        {
            int tankid = Convert.ToInt32(tankids);

            //  update tankstock 
            using (GazOnDevEntities db = new GazOnDevEntities())
            {
               

                Tank_Stocks edittank = db.Tank_Stocks.SingleOrDefault(x => x.Id == tankid);
                edittank.invoiceid = invoicenumber;
                if (string.IsNullOrEmpty(invoicenumber))
                {
                    edittank.TankSystemStatus = "1";
                }
                else
                {
                    edittank.TankSystemStatus = "4";
                }
                //db.Tank_Stocks.Attach(edittank);
                db.ObjectStateManager.ChangeObjectState(edittank, EntityState.Modified);
                db.SaveChanges();


            }
        
        }
        private void btnupload_Click_1(object sender, EventArgs e)
        {
            InvoiceControlTankStockAdd dd = new InvoiceControlTankStockAdd();
           dd.FormClosing+=new Gizmox.WebGUI.Forms.Form.FormClosingEventHandler(dd2_FormClosing);


            dd.ShowDialog();

        }

        void dd2_FormClosing(object sender, FormClosingEventArgs e)
        {



           

            InvoiceControlTankStockAdd ctrl = (InvoiceControlTankStockAdd)sender;

            if (string.IsNullOrEmpty(ctrl.TankNumber))
                return;
            int i;
            i = dataGridView1.Rows.Add(new DataGridViewRow());

            DataGridViewCell cell1 = new DataGridViewTextBoxCell();
            cell1.Value = "צובר " + ctrl.tankSize + " גלון מספר " + ctrl.TankNumber;

            if (!string.IsNullOrEmpty(tanktofix.TankFixNumber))
            {

                cell1.Value += " מספר שיפוץ " + tanktofix.TankFixNumber;
            }
            dataGridView1.Rows[i].Cells["dtclmnTitle"] = cell1;
            
            invoiceitem newrow = new invoiceitem();


            newrow.title = "צובר " + ctrl.tankSize + " גלון מספר " + ctrl.TankNumber;

            if (!string.IsNullOrEmpty(tanktofix.TankFixNumber))
            {

                newrow.title  += " מספר שיפוץ " + tanktofix.TankFixNumber;
            }

         

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl.Note;
            newrow.note = ctrl.Note;
            dataGridView1.Rows[i].Cells["dtclmnNote"] = cell1;



            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl._Amount;
            newrow.amount = Convert.ToInt32(ctrl._Amount);
            dataGridView1.Rows[i].Cells["dtclmnAmount"] = cell1;

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = i + 1;
            newrow.num = (i + 1).ToString();
            dataGridView1.Rows[i].Cells["dtclmnid"] = cell1;


            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl._Type;
            newrow.type = ctrl._Type;
            dataGridView1.Rows[i].Cells["dttype"] = cell1;

            cell1 = new DataGridViewTextBoxCell();
            cell1.Value = ctrl._Typeid;
            newrow.typeid = ctrl._Typeid;
            dataGridView1.Rows[i].Cells["dttypeid"] = cell1;

            _currentinvoiceitems.Add(newrow);

            if (ctrl._Type == "tank")
            {
                if (null == _currentinvoice)
                {
                    updateTankStock(ctrl._Typeid, txtinvoiceid.Text);
                
                }
                else
                {
                    updateTankStock(ctrl._Typeid, _currentinvoice.invoiceNumber);
                }
                    havetank = true;
                
            }
           
        }

        private void btnPrint_Click(object sender, EventArgs e)
        {
            if(null != _currentinvoice)
            {
                 // MessageBox.Show("פעולת ההוספה הצליחה");
            frmReportTankRecipet tanko = new frmReportTankRecipet(Convert.ToInt32(_currentinvoice.invoiceNumber), "report3");
            tanko.ShowDialog();
            }else
            {
                MessageBox.Show("נא קיים תעודה כזו נא לשמור או לבחור חדשה ");
            }
           
        }

        public EventHandler OnEditButtonClick { get; set; }
    }

}